package com.guigu.mq.controller;

import com.guigu.mq.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName:PayMessageController
 * @Description://TODO
 * @Author:taoLong
 * @Date:2021/11/17:9:29 星期三
 * @email:2391611102@qq.com or 2391611102qq@gmail.com
 */
@RestController
@RequestMapping("/pay")
public class PayMessageController {

    @Autowired
    private PayService payService;

    /**
     * 发送消息
     *
     * @param orderId 订单ID
     * @return
     */
    @GetMapping("/sendPayMessage/{orderId}")
    public String sendPayMessage(@PathVariable("orderId") String orderId) {
        payService.sendPayMessage("DirectExchange", "pay", orderId);
        return "success";
    }
}
